<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>客户列表</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/common/css/dataTables.bootstrap.css" rel="stylesheet">
    <!--分页样式-->
    <style type="text/css">
        div.green-black{padding:3px;margin:3px;text-align:center;}
        div.green-black a{border:#2c2c2c 1px solid;padding:2px 5px;background: #2c2c2c;color:#fff;margin:0 2px 0 0;text-decoration:none;}
        div.green-black a:hover{border:#aad83e 1px solid;background:#aad83e;color:#fff;}
        div.green-black a:active{border:#aad83e 1px solid;background:#aad83e;color:#fff;}
        div.green-black span.current{border:#aad83e 1px solid;padding:2px 5px;font-weight:bold;background:#aad83e;color:#fff;margin:0 2px 0 0;}
        div.green-black span.disabled{border:#f3f3f3 1px solid;padding:2px 5px;color:#ccc;margin:0 2px 0 0;}
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>客户MT4列表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">

                        <form action="__MODULE__/MyDeal/Funding" method="post">
                            <div class="col-sm-2 m-b-xs">
                                <select name="user_id" class="input-sm form-control input-s-sm inline">
                                    <option value="{$user.user_id}">{$user.user_id}</option>
                                </select>
                            </div>
                            <div class="col-sm-4 m-b-xs">
                                <!--时间 ：-->
                                <input type="hidden" id="from" name="fo" value="{$fo}" placeholder="开始时间" class="laydate-icon form-control layer-date" style="width:40%;display:inline-block;">
                                <input type="hidden" id="to" name="to" value="{$to}" placeholder="结束时间" class="laydate-icon form-control layer-date" style="width:40%;display:inline-block;">
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <span class="input-group-btn">
                                        <!--<button type="submit" class="btn btn-w-m btn-info">搜索</button>-->
                                    </span>
                                </div>
                            </div>
                        </form>

                    </div>
                    <button type="button" class="btn btn-w-m btn-info" onclick="UserList_download(this,'{$user.user_id}');"><i class="fa fa-download">下载客户数据</i></button>
                    <div class="table-responsive" style="border-top: 1px solid rgb(221, 221, 221);margin-top: 15px;">
                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                            <tr class="gradeX" style="text-align: center;">
                                <th>MT4账号</th>
                                <th>姓名</th>
                                <th>邮箱</th>
                                <th>职位</th>
                                <th>杠杆</th>
                                <th>推荐人</th>
                                <th>层级</th>
                                <th>交易明细</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="mt4_list" item="data">
                                <tr class="gradeX" style="text-align: center;">
                                    <td>{$data.user_id}</td>
                                    <td><span class="pie">{$data.name_zh_cn}</span></td>
                                    <td>{$data.user_email}</td>
                                    <foreach name="position" item="po">
                                        <if condition="$po['id'] eq $data['position']">
                                            <td>{$po.user_position}</td>
                                        </if>
                                    </foreach>
                                    <td>{$data.level}</td>
                                    <td>{$data.user_recommend}</td>
                                    <td>{$data.class}</td>
                                    <td><a href="__MODULE__/Subordinate/Mt4_detailed/LOGIN/{$data.user_id}">查看</a></td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->
<!--<script src="__PUBLIC__/admin/js/plugins/peity/jquery.peity.min.js"></script>-->
<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<!--<script src="__PUBLIC__/common/js/layer_show.js"></script>-->
<script src="__PUBLIC__/common/js/dataTables/jquery.dataTables.js"></script>
<script src="__PUBLIC__/common/js/dataTables/dataTables.bootstrap.js"></script>
<!-- iCheck -->
<!--<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>-->
<script src="__PUBLIC__/admin/js/plugins/layer/laydate/laydate.js"></script>
<script>
    $(document).ready(function () {
        laydate({
            elem: '#from', /*目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'*/
            event: 'focus', /*响应事件。如果没有传入event，则按照默认的click*/
            //format: 'YYYY-MM-DD hh:mm:ss',
        });
        laydate({
            elem: '#to', /*目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'*/
            event: 'focus', /*响应事件。如果没有传入event，则按照默认的click*/
            //format: 'YYYY-MM-DD hh:mm:ss',
        });
//
//        $(".btn-info").on('click',function () {
//            var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
//        })
//        layer.close(index);
    });
//分页
    $(document).ready(function () {
        $('.dataTables-example').dataTable();

        /* Init DataTables */
        var oTable = $('#editable').dataTable();

        /* Apply the jEditable handlers to the table */
        oTable.$('td').editable('../example_ajax.php', {
            "callback": function (sValue, y) {
                var aPos = oTable.fnGetPosition(this);
                oTable.fnUpdate(sValue, aPos[0], aPos[1]);
            },
            "submitdata": function (value, settings) {
                return {
                    "row_id": this.parentNode.getAttribute('id'),
                    "column": oTable.fnGetPosition(this)[2]
                };
            },
            "width": "100%",
            "height": "100%"
        });
    });

    function UserList_download(obj,id) {
        if(id){
            window.open('__MODULE__/Subordinate/UserList_download');
//            layer.close(index);
        }else{

            layer.msg('信息错误');
        }
    }
</script>
</body>
</html>
